//
//  Language.swift
//  ChatMLX
//
//  Created by John Mai on 2024/8/19.
//

import Defaults

enum Language: String, CaseIterable, Identifiable, Defaults.Serializable {
    case english = "en"
    case arabic = "ar"
    case chineseHongKong = "zh-HK"
    case simplifiedChinese = "zh-Hans"
    case traditionalChinese = "zh-Hant"
    case catalan = "ca"
    case croatian = "hr"
    case czech = "cs"
    case danish = "da"
    case dutch = "nl"
    case enAU = "en-AU"
    case enGB = "en-GB"
    case enIN = "en-IN"
    case finnish = "fi"
    case french = "fr"
    case frenchCanadian = "fr-CA"
    case de = "de"
    case greek = "el"
    case hebrew = "he"
    case hindi = "hi"
    case hungarian = "hu"
    case indonesian = "id"
    case italian = "it"
    case japanese = "ja"
    case korean = "ko"
    case malay = "ms"
    case norwegian = "nb"
    case polish = "pl"
    case portuguese = "pt-PT"
    case portugueseBrazilian = "pt-BR"
    case romanian = "ro"
    case russian = "ru"
    case slovak = "sk"
    case spanish = "es"
    case spanishLatinAmerica = "es-419"
    case swedish = "sv"
    case thai = "th"
    case turkish = "tr"
    case ukrainian = "uk"
    case vietnamese = "vi"

    var id: String { self.rawValue }

    var displayName: String {
        switch self {
        case .english: return "English"
        case .arabic: return "العربية"
        case .chineseHongKong: return "中文（香港）"
        case .simplifiedChinese: return "简体中文"
        case .traditionalChinese: return "繁體中文"
        case .catalan: return "Català"
        case .croatian: return "Hrvatski"
        case .czech: return "Čeština"
        case .danish: return "Dansk"
        case .dutch: return "Nederlands"
        case .enAU: return "Australian English"
        case .enGB: return "British English"
        case .enIN: return "Indian English"
        case .finnish: return "Suomi"
        case .french: return "Français"
        case .frenchCanadian: return "Français Canadien"
        case .de: return "Deutsch"
        case .greek: return "Ελληνικά"
        case .hebrew: return "עברית"
        case .hindi: return "हिन्दी"
        case .hungarian: return "Magyar"
        case .indonesian: return "Bahasa Indonesia"
        case .italian: return "Italiano"
        case .japanese: return "日本語"
        case .korean: return "한국어"
        case .malay: return "Bahasa Melayu"
        case .norwegian: return "Norsk"
        case .polish: return "Polski"
        case .portuguese: return "Português"
        case .portugueseBrazilian: return "Português Brasileiro"
        case .romanian: return "Română"
        case .russian: return "Русский"
        case .slovak: return "Slovenčina"
        case .spanish: return "Español"
        case .spanishLatinAmerica: return "Español Latinoamericano"
        case .swedish: return "Svenska"
        case .thai: return "ไทย"
        case .turkish: return "Türkçe"
        case .ukrainian: return "Українська"
        case .vietnamese: return "Tiếng Việt"            
        }
    }
}
